layui.use(['form', 'layer', 'table', 'laytpl', 'upload'], function () {
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table;
    upload = layui.upload;
    //
    // var url ="http://127.0.0.1:8080/export/word-to-pdf";
    // window.open(url);



    $(".showPDF_btn").click(function () {



        // static/js/pdf/web/viewer.html
       // var src="/pdf/web/viewer.html?file=/export/word-to-pdf";
        // http://www.a.com/fi
       var url ="http://localhost:8081/document/pdf";
        window.open(url);

        // D:\dev_project\workspace\xpyd\src\main\resources\static\js\pdf\web\viewer.html
        // window.open('/static/js/pdf/web/viewer.html?file=' +encodeURIComponent( url));
        // $("body").append("<iframe width=“80%” height=“80%” src=’"+src+"’ />");
    });
    //列表操作
    table.on('tool(userList)', function (obj) {
        var layEvent = obj.event,
            data = obj.data;

        if (layEvent === 'edit') { //编辑
            addUser(data);
        }   else if (layEvent === 'del') { //删除
            layer.confirm('确定删除吗？', {icon: 3, title: '提示信息'}, function (index) {
                $.post("../../information/del", {
                    id: data.id  //将需要删除的newsId作为参res数传入
                }, function (res) {
                    top.layer.msg(res.msg);
                    tableIns.reload();
                    layer.close(index);
                })
            });
        }
    });

})
